home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / driverss.zip / PKVEC.ASM < prev    next >
Assembly Source File  |  1989-11-15  |  2KB  |  119 lines

  1.     .MODEL    MEMMOD,C
  2.     %MACS
  3.     extrn    pkint:proc
  4.  
  5.     .DATA
  6.     extrn    Stktop
  7.  
  8.     .CODE
  9. sssave    dw    ?
  10. spsave    dw    ?
  11. dbase    dw    @Data
  12.  
  13. ; pkvec0 - Packet driver receive call handler #0
  14.     public    pkvec0
  15.     label    pkvec0    far
  16.     pushf            ; save his interrupt state
  17.     cli            ; no distractions
  18.     mov    cs:sssave,ss    ; stash user stack context
  19.     mov    cs:spsave,sp
  20.  
  21.     mov    ss,cs:dbase    ; set up interrupt stack
  22.     lea    sp,Stktop
  23.  
  24.     ; save regs, making them available to pkint()
  25.     push    es
  26.     push    ds
  27.     push    ax
  28.     push    bx
  29.     push    cx
  30.     push    dx
  31.     push    bp
  32.     push    si
  33.     push    di
  34.  
  35.     mov    ax,ss
  36.     mov    ds,ax
  37.     mov    ax,0    ; device #0
  38.     push    ax
  39.     call    pkint
  40.     jmp    pkret
  41.  
  42. ; pkvec1 - Packet driver receive call handler #1
  43.     public    pkvec1
  44.     label    pkvec1    far
  45.     pushf            ; save his interrupt state
  46.     cli            ; no distractions
  47.     mov    cs:sssave,ss    ; stash user stack context
  48.     mov    cs:spsave,sp
  49.  
  50.     mov    ss,cs:dbase    ; set up interrupt stack
  51.     lea    sp,Stktop
  52.  
  53.     ; save regs, making them available to pkint()
  54.     push    es
  55.     push    ds
  56.     push    ax
  57.     push    bx
  58.     push    cx
  59.     push    dx
  60.     push    bp
  61.     push    si
  62.     push    di
  63.  
  64.     mov    ax,ss
  65.     mov    ds,ax
  66.     mov    ax,1    ; device #1
  67.     push    ax
  68.     call    pkint
  69.     jmp    pkret
  70.  
  71. ; pkvec2 - Packet driver receive call handler #2
  72.     public    pkvec2
  73.     label    pkvec2    far
  74.     pushf            ; save his interrupt state
  75.     cli            ; no distractions
  76.     mov    cs:sssave,ss    ; stash user stack context
  77.     mov    cs:spsave,sp
  78.  
  79.     mov    ss,cs:dbase    ; set up interrupt stack
  80.     lea    sp,Stktop
  81.  
  82.     ; save regs, making them available to pkint()
  83.     push    es
  84.     push    ds
  85.     push    ax
  86.     push    bx
  87.     push    cx
  88.     push    dx
  89.     push    bp
  90.     push    si
  91.     push    di
  92.  
  93.     mov    ax,ss
  94.     mov    ds,ax
  95.     mov    ax,2    ; device #2
  96.     push    ax
  97.     call    pkint
  98.     jmp    pkret
  99.  
  100. ; common return for all packet drivers
  101.     label    pkret    near
  102.     pop    ax    ; pop dev # arg
  103.     pop    di
  104.     pop    si
  105.     pop    bp
  106.     pop    dx
  107.     pop    cx
  108.     pop    bx
  109.     pop    ax
  110.     pop    ds
  111.     pop    es
  112.  
  113.     mov    ss,cs:sssave
  114.     mov    sp,cs:spsave    ; restore original stack context
  115.     popf
  116.     retf
  117.  
  118.     end
  119.